package handlers

import (
	"chinaport-proxy/protocol"
	"context"
)

// UKeyClient defines the interface for UKey client operations
type UKeyClient interface {
	CallWithRequestID(method protocol.Method, args interface{}, requestID string) (*protocol.Response, error)
	Call(method protocol.Method, args interface{}) (*protocol.Response, error)
	CallWithContext(ctx context.Context, method protocol.Method, args interface{}) (*protocol.Response, error)
	SetWebhookService(ws interface {
		NotifyConnectionFailure(ctx context.Context, err error)
		NotifyHealthCheckFailure(ctx context.Context, err error)
	})
	Close() error
}

// WebhookService defines the interface for webhook operations
type WebhookService interface {
	NotifyOperationFailure(ctx context.Context, method string, errors []string)
	SendAudit(ctx context.Context, requestID, method string, request, response interface{}, success bool, errorMsg string, durationMs int64)
}
